package com.foodsafe.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Additivecategory entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "additivecategory", catalog = "foodsafe")
public class Additivecategory implements java.io.Serializable {

	// Fields

	private Integer addtiveCategoryId;
	private String addtiveCategoryName;
	private String addtiveCategoryDescr;
	private Set<Additives> additiveses = new HashSet<Additives>(0);

	// Constructors

	/** default constructor */
	public Additivecategory() {
	}

	/** full constructor */
	public Additivecategory(String addtiveCategoryName,
			String addtiveCategoryDescr, Set<Additives> additiveses) {
		this.addtiveCategoryName = addtiveCategoryName;
		this.addtiveCategoryDescr = addtiveCategoryDescr;
		this.additiveses = additiveses;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "AddtiveCategoryId", unique = true, nullable = false)
	public Integer getAddtiveCategoryId() {
		return this.addtiveCategoryId;
	}

	public void setAddtiveCategoryId(Integer addtiveCategoryId) {
		this.addtiveCategoryId = addtiveCategoryId;
	}

	@Column(name = "AddtiveCategoryName", length = 32)
	public String getAddtiveCategoryName() {
		return this.addtiveCategoryName;
	}

	public void setAddtiveCategoryName(String addtiveCategoryName) {
		this.addtiveCategoryName = addtiveCategoryName;
	}

	@Column(name = "AddtiveCategoryDescr", length = 64)
	public String getAddtiveCategoryDescr() {
		return this.addtiveCategoryDescr;
	}

	public void setAddtiveCategoryDescr(String addtiveCategoryDescr) {
		this.addtiveCategoryDescr = addtiveCategoryDescr;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "additivecategory")
	public Set<Additives> getAdditiveses() {
		return this.additiveses;
	}

	public void setAdditiveses(Set<Additives> additiveses) {
		this.additiveses = additiveses;
	}

}